package org.lex.collection.tree.diff;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.lex.collection.tree.ITreeNode;

public abstract class AbstractNodeComparator implements INodeComparator {
	@Override
	public DiffSet compareNodes(DiffSet result, ITreeNode[] oldNodes, ITreeNode[] newNodes) {
		return compareNodes(result, list(oldNodes), list(newNodes));
	}

	protected List<ITreeNode> list(ITreeNode... elements) {
		List<ITreeNode> list = new ArrayList<ITreeNode>(elements.length);
		Collections.addAll(list, elements);
		return list;
	}
}
